<!-- HTML code for two text input areas -->
<!DOCTYPE html>
<html>

<head>
    <title>Text Input remove Enter</title>
    <script>
        function updateInput() {
            var input = document.getElementById("input");
            var output = document.getElementById("output");
            const onputText = input.value.replace(/\n/g, " ");
            output.value = onputText;
            const clipboard = navigator.clipboard;  // 剪贴板
            navigator.clipboard.writeText(onputText);
        }
    </script>
</head>

<body>
    <form>
        <!-- text input area -->
        <label for="input">Text Input:</label>
        <textarea type="text" id="input" name="input" oninput="updateInput()"> </textarea>
        <br>
        <!-- text onput area -->
        <label for="output">Text output:</label>
        <textarea type="text" id="output" name="output" readonly></textarea>
    </form>
</body>

</html>